﻿using System;
using System.Collections.Generic;
using System.Text;
using ContentRenderingApi.Extender;
using ContentRenderingApi.Path;

namespace ContentRenderingApi.Skeleton
{
    /// <summary/>
    internal class PreOverrideSkeleton 
    {
        private AbstractPath _path;
        private Func<NodeExtender, object[]> _preOverrideCallback;

        /// <summary/>
        internal PreOverrideSkeleton(
            AbstractPath path,
            Func<NodeExtender, object[]> preOverrideCallback)
        {
            this._path = path;
            this._preOverrideCallback = preOverrideCallback;
        }

        /// <summary/>
        public AbstractPath Path
        {
            get { return this._path; }
        }

        /// <summary/>
        public object[] Invoke(NodeExtender nodeExtender)
        {
            return this._preOverrideCallback(nodeExtender);
        }
    }
}
